import axios from "axios";

import router from "@/router/index";



axios.defaults.baseURL='http://localhost';


/*动态加载路由*/
await axios.post('/system/menu/router').then(resp=>{
  resp.data.some(m=>{
    router.addRoute(
        {
            path: '/',
            component: import('@/layout/index.vue'),
            meta:{ name:m.menuName },
            children: [
                {
                    path: '/'+m.path,
                    component: () => import("/src/views/"+m.component+".vue"),
                }
            ]
        }
    )
  })
})

export default router;